package zy1208.zy20;

import java.lang.reflect.Constructor;

public class demo {
    public static void main(String[] args) {

    }
    public Object invokeMethod(Object obj, String methodName, Object[] args)  throws Exception{
        Class<?> aClass = Class.forName(methodName);
        Constructor<?> c = aClass.getDeclaredConstructor(String.class, int.class);
        Object o = c.newInstance(obj, args);

        return o;
    }
}
